package com.fms.trollalarm.fragment;

import com.fms.trollalarm.object.LevelType;
import com.fms.trollalarm.object.TrollType;
import com.fms.trollalarm.utils.Common;

import android.support.v4.app.Fragment;

public class AlarmFragment extends Fragment {
	private OnAlarmListener listener;

	public void setOnStopAlarm() {
		if (listener != null) {
			listener.onStopAlarm();
		}
	}

	public void setOnSnoozeAlarm() {
		if (listener != null) {
			listener.onSnoozeAlarm();
		}
	}

	public void setOnChangeTrollType(TrollType trollType) {
		if (listener != null) {
			listener.onChangeTrollType(trollType);
		}
	}

	public void setOnAlarmListener(OnAlarmListener listener) {
		this.listener = listener;
	}

	public interface OnAlarmListener {
		public void onStopAlarm();

		public void onSnoozeAlarm();

		public void onChangeTrollType(TrollType trollType);
	}

	public int getTrollLevel() {
		return getArguments().getInt(Common.IntentExtra.TROLL_LEVEL,
				LevelType.EASY.ordinal());
	}
}
